﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Data.Linq;
using System.Reflection;
using System.Data.Linq.Mapping;

namespace Common.DataLayer
{
    partial class CommonDataContext
    {
        public CommonDataContext() :
            base(Common.Properties.Settings.Default.ConnectionString, mappingSource)
        {
            OnCreated();
        }

        [Function(Name = "GetDate", IsComposable = true)]
        public DateTime GetSystemDate()
        {
            MethodInfo mi = MethodBase.GetCurrentMethod() as MethodInfo;
            return (DateTime)this.ExecuteMethodCall(this, mi, new object[] { }).ReturnValue;
        }
    }
}
